import IScript from "../IScript";
import root from "../../types/msg"
import {move } from "../../msg/msg"
import {friend } from "../../msg/msg"
import MsgSend from "../../msg/MsgSend";

export  class S2C_SyncPositionScript implements IScript {

    private static  _instance = new S2C_SyncPositionScript()
    public static get instance(){
        return S2C_SyncPositionScript._instance;
    }
    private constructor(){}

    excute(obj: any) {
        this.handle(obj )
    }

    handle(msg: root.move.S2C_SyncPosition) {
        console.log("收到服务器同步坐标消息：",msg);
        
        // let resp:root.friend.IC2S_FriendListReq = {
        //     uid: 3,
        //     list: []
        // }
        // console.log("响应服务器同步坐标消息：",resp);
        // MsgSend.send(friend.C2S_FriendListReq,resp)
        let resp:root.move.IC2S_SyncPosition = {
            x: 3,
            y: 3,
            str:"1231中广打23"
        }
        console.log("响应服务器同步坐标消息：",resp);
        MsgSend.send(move.C2S_SyncPosition,resp)
    }
}

export default S2C_SyncPositionScript.instance
